home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume6 / xfig2 / patch5c < prev    next >
Encoding:
Internet Message Format  |  1993-04-28  |  49.4 KB

  1. From: envbvs@epb2.lbl.gov (Brian V. Smith)
  2. Newsgroups: comp.sources.x
  3. Subject: v06i052: xfig 2.0 (part 3/7), Patch5
  4. Message-ID: <133693@sun.Eng.Sun.COM>
  5. Date: 30 Mar 90 04:33:06 GMT
  6. Approved: argv@sun.com
  7.  
  8. Submitted-by: envbvs@epb2.lbl.gov (Brian V. Smith)
  9. Posting-number: Volume 6, Issue 52
  10. Archive-name: xfig2/patch5c
  11. Patch-To: xfig2: Volume 6, Issue 9-24,34-36
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 3 (of 7)."
  20. # Contents:  draw.c.diff f2ps.c.diff printfonts.c.diff scale.c.diff
  21. #   spline.c.diff xtra.c.diff
  22. # Wrapped by envbvs@epb2.lbl.gov on Wed Mar 28 09:04:50 1990
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'draw.c.diff' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'draw.c.diff'\"
  26. else
  27. echo shar: Extracting \"'draw.c.diff'\" \(10337 characters\)
  28. sed "s/^X//" >'draw.c.diff' <<'END_OF_FILE'
  29. X*** draw.c.p5    Thu Mar  1 09:47:45 1990
  30. X--- draw.c    Mon Mar 26 15:40:38 1990
  31. X***************
  32. X*** 34,45 ****
  33. X  {
  34. X      F_spline    *s;
  35. X  
  36. X-     pw_batch_on(canvas_pixwin);
  37. X      for (s = splines; s != NULL; s = s->next) {
  38. X          if (pointmarker_shown) toggle_splinepointmarker(s);
  39. X          draw_spline(s, ERASE);
  40. X          };
  41. X-     pw_batch_off(canvas_pixwin);
  42. X      }
  43. X  
  44. X  erase_ellipses(ellipses)
  45. X--- 34,43 ----
  46. X***************
  47. X*** 47,58 ****
  48. X  {
  49. X      F_ellipse    *e;
  50. X  
  51. X-     pw_batch_on(canvas_pixwin);
  52. X      for (e = ellipses; e != NULL; e = e->next) {
  53. X          if (pointmarker_shown) toggle_ellipsepointmarker(e);
  54. X          draw_ellipse(e, background_color);
  55. X          };
  56. X-     pw_batch_off(canvas_pixwin);
  57. X      }
  58. X  
  59. X  erase_arcs(arcs)
  60. X--- 45,54 ----
  61. X***************
  62. X*** 60,71 ****
  63. X  {
  64. X      F_arc    *a;
  65. X  
  66. X-     pw_batch_on(canvas_pixwin);
  67. X      for (a = arcs; a != NULL; a = a->next) {
  68. X          if (pointmarker_shown) toggle_arcpointmarker(a);
  69. X          draw_arc(a, background_color);
  70. X          };
  71. X-     pw_batch_off(canvas_pixwin);
  72. X      }
  73. X  
  74. X  erase_compounds(compounds)
  75. X--- 56,65 ----
  76. X***************
  77. X*** 118,129 ****
  78. X  {
  79. X      F_ellipse    *e;
  80. X  
  81. X-     pw_batch_on(canvas_pixwin);
  82. X      for (e = ellipses; e != NULL; e = e->next) {
  83. X          draw_ellipse(e, foreground_color);
  84. X          if (pointmarker_shown) toggle_ellipsepointmarker(e);
  85. X          };
  86. X-     pw_batch_off(canvas_pixwin);
  87. X      }
  88. X  
  89. X  draw_arcs(arcs)
  90. X--- 112,121 ----
  91. X***************
  92. X*** 131,142 ****
  93. X  {
  94. X      F_arc    *a;
  95. X  
  96. X-     pw_batch_on(canvas_pixwin);
  97. X      for (a = arcs; a != NULL; a = a->next) {
  98. X          draw_arc(a, foreground_color);
  99. X          if (pointmarker_shown) toggle_arcpointmarker(a);
  100. X          };
  101. X-     pw_batch_off(canvas_pixwin);
  102. X      }
  103. X  
  104. X  draw_lines(lines)
  105. X--- 123,132 ----
  106. X***************
  107. X*** 144,156 ****
  108. X  {
  109. X      F_line    *l;
  110. X  
  111. X-     pw_batch_on(canvas_pixwin);
  112. X      for (l = lines; l != NULL; l = l->next) {
  113. X          draw_line(l, PAINT);
  114. X          if (pointmarker_shown) 
  115. X          toggle_linepointmarker(l);
  116. X          }
  117. X-     pw_batch_off(canvas_pixwin);
  118. X      }
  119. X  
  120. X  draw_splines(splines)
  121. X--- 134,144 ----
  122. X***************
  123. X*** 158,169 ****
  124. X  {
  125. X      F_spline    *s;
  126. X  
  127. X-     pw_batch_on(canvas_pixwin);
  128. X      for (s = splines; s != NULL; s = s->next) {
  129. X          draw_spline(s, PAINT);
  130. X          if (pointmarker_shown) toggle_splinepointmarker(s);
  131. X          };
  132. X-     pw_batch_off(canvas_pixwin);
  133. X      }
  134. X  
  135. X  draw_texts(texts)
  136. X--- 146,155 ----
  137. X***************
  138. X*** 211,218 ****
  139. X      y = yb + wid / 2;
  140. X      xd = x*cosa + y*sina + .5;
  141. X      yd = -x*sina + y*cosa + .5;
  142. X!     pw_vector(canvas_pixwin, xc, yc, x2, y2, op, (int) arrow->thickness);
  143. X!     pw_vector(canvas_pixwin, xd, yd, x2, y2, op, (int) arrow->thickness);
  144. X      }
  145. X  
  146. X  draw_spline(spline, op)
  147. X--- 197,206 ----
  148. X      y = yb + wid / 2;
  149. X      xd = x*cosa + y*sina + .5;
  150. X      yd = -x*sina + y*cosa + .5;
  151. X!     pw_vector(canvas_pixwin, xc, yc, x2, y2, op, 
  152. X!            (int) arrow->thickness, arrow->style, 0.0);
  153. X!     pw_vector(canvas_pixwin, xd, yd, x2, y2, op, 
  154. X!            (int) arrow->thickness, arrow->style, 0.0);
  155. X      }
  156. X  
  157. X  draw_spline(spline, op)
  158. X***************
  159. X*** 279,288 ****
  160. X  F_line    *line;
  161. X  int    op;
  162. X  {
  163. X!     F_point            *point;
  164. X!     int            xx, yy, x, y;
  165. X  
  166. X!     /* added 3/1/89 B.V.Smith */
  167. X      fill_object(line,op);
  168. X  
  169. X      if (line->type == T_ARC_BOX)    /* box with rounded corners */
  170. X--- 267,278 ----
  171. X  F_line    *line;
  172. X  int    op;
  173. X  {
  174. X!     F_point        *point;
  175. X!     XPoint        *points, *pptr;
  176. X!     int        npoints;
  177. X!     int        xx, yy, x, y;
  178. X  
  179. X!     /* fill the object first then draw outline */
  180. X      fill_object(line,op);
  181. X  
  182. X      if (line->type == T_ARC_BOX)    /* box with rounded corners */
  183. X***************
  184. X*** 292,297 ****
  185. X--- 282,288 ----
  186. X          }
  187. X  
  188. X      point = line->points;
  189. X+     /* get and save first point */
  190. X      x = point->x;
  191. X      y = point->y;
  192. X      if (line->points->next == NULL) { /* A single point */
  193. X***************
  194. X*** 301,397 ****
  195. X      if (line->back_arrow) /* backward arrow  */
  196. X          draw_arrow(point->next->x, point->next->y, x, y, 
  197. X          line->back_arrow, op);
  198. X!     for (point = point->next; point != NULL; point = point->next) {
  199. X!         draw_line_segment(line->style, line->style_val, 
  200. X!                 x, y, point->x, point->y, op, line->thickness);
  201. X          xx = x; yy = y;
  202. X          x = point->x;
  203. X          y = point->y;
  204. X          }
  205. X      if (line->for_arrow) 
  206. X          draw_arrow(xx, yy, x, y, line->for_arrow, op);
  207. X      }
  208. X  
  209. X- #define        round(x)    ((int)((x) + .5))
  210. X- #define        dash_length    style_val
  211. X- #define        dot_gap        style_val
  212. X- 
  213. X- draw_line_segment(line_style, style_val, x1, y1, x2, y2, op, thick)
  214. X- int    line_style, x1, y1, x2, y2, op, thick;
  215. X- float    style_val;
  216. X- {
  217. X-     switch (line_style) {
  218. X-         case SOLID_LINE :
  219. X-         pw_vector(canvas_pixwin, x1, y1, x2, y2, op, thick);
  220. X-         break;
  221. X-         case DASH_LINE : {
  222. X-         float    x, y, leng, dx, dy, dash_x, dash_y;
  223. X-         float    spacing_leng, space_x, space_y;
  224. X-         int    num_spacing;
  225. X- 
  226. X-         dx = x2 - x1;
  227. X-         dy = y2 - y1;
  228. X-         leng = sqrt((double)(dx*dx + dy*dy));
  229. X-         if(leng == 0)
  230. X-             break;
  231. X-         if (leng <= dash_length) {
  232. X-             pw_vector(canvas_pixwin, x1, y1, x2, y2, op, thick);
  233. X-             break;
  234. X-             }
  235. X-         dash_x = dash_length * dx / leng;
  236. X-         dash_y = dash_length * dy / leng;
  237. X-         num_spacing = (leng - dash_length) / (2 * dash_length);
  238. X-         if (num_spacing == 0)
  239. X-             spacing_leng = leng;
  240. X-         else
  241. X-             spacing_leng = (leng - dash_length * (num_spacing + 1)) /
  242. X-                 ((float)num_spacing);
  243. X-         space_x = spacing_leng * dx / leng;
  244. X-         space_y = spacing_leng * dy / leng;
  245. X-         dx = dash_x + space_x;  dy = dash_y + space_y;
  246. X-         for (x = x1, y = y1; leng > 0; 
  247. X-             x += dx, y += dy, leng -= dash_length + spacing_leng) {
  248. X-             pw_vector(canvas_pixwin, round(x), round(y), 
  249. X-                 round(x + dash_x), round(y + dash_y), op, thick);
  250. X-             }
  251. X-         break;
  252. X-         }
  253. X-         case DOTTED_LINE : {
  254. X-         float    x, y, leng, dx, dy, gap_x, gap_y;
  255. X-         int    n, color;
  256. X- 
  257. X-         dot_gap += 1.0;
  258. X-         dx = x2 - x1;
  259. X-         dy = y2 - y1;
  260. X-         leng = sqrt((double)(dx*dx + dy*dy)) - 1;
  261. X-         n = round(leng/dot_gap);
  262. X-         if (op == PAINT)
  263. X-             color = foreground_color;
  264. X-         else
  265. X-             color = background_color;
  266. X-         if (n <= 1) {
  267. X-             /*
  268. X-             pw_vector(canvas_pixwin, x1, y1, x1, y1, op, thick);
  269. X-             */
  270. X-             pw_put(canvas_pixwin, x1, y1, color, thick);
  271. X-             pw_put(canvas_pixwin, x2, y2, color, thick);
  272. X-             break;
  273. X-             }
  274. X-         if(leng == 0)
  275. X-             break;
  276. X-         dot_gap = leng / n;
  277. X-         gap_x = dot_gap * dx / leng;
  278. X-         gap_y = dot_gap * dy / leng;
  279. X-         for (x = x1, y = y1; n-- >= 0; x += gap_x, y += gap_y)
  280. X-             /*
  281. X-             pw_vector(canvas_pixwin,round(x),round(y),round(x),round(y),op,thick);
  282. X-             */
  283. X-             pw_put(canvas_pixwin, round(x), round(y), color, thick);
  284. X-         break;
  285. X-         }
  286. X-         }
  287. X-     }
  288. X- 
  289. X  draw_arc_box(line, op)
  290. X  F_line *line;
  291. X  int op;
  292. X--- 292,337 ----
  293. X      if (line->back_arrow) /* backward arrow  */
  294. X          draw_arrow(point->next->x, point->next->y, x, y, 
  295. X          line->back_arrow, op);
  296. X!     if (line->style == SOLID_LINE)    /* accumulate the points for solid line */
  297. X!         {
  298. X!         npoints = 0;
  299. X!         /* count number of points in this object */
  300. X!         for ( ; point != NULL; point = point->next)
  301. X!             npoints++;
  302. X!         /* accumulate the points in an array */
  303. X!         if ((points = (XPoint *) malloc(npoints*sizeof(XPoint))) == 0)
  304. X!             {
  305. X!             fprintf(stderr,"draw_line(): No memory\n");
  306. X!             return;
  307. X!             }
  308. X!         pptr = points;
  309. X!         }
  310. X!     for (point=line->points; point != NULL; point = point->next) {
  311. X!         if (line->style == SOLID_LINE)
  312. X!             {
  313. X!             pptr->x = point->x;
  314. X!             pptr->y = point->y;
  315. X!             pptr++;
  316. X!             }
  317. X!         else    /* draw dashed or dotted line segment by segment
  318. X!                otherwise when moving one segment later there
  319. X!                is an alignment problem with the dashes */
  320. X!         pw_vector(canvas_pixwin, x, y, point->x, point->y, op,
  321. X!             line->thickness, line->style, line->style_val);
  322. X          xx = x; yy = y;
  323. X          x = point->x;
  324. X          y = point->y;
  325. X          }
  326. X+     if (line->style == SOLID_LINE)
  327. X+         {
  328. X+         pw_lines(canvas_pixwin, points, npoints, op, 
  329. X+         line->thickness, line->style, line->style_val, 0);
  330. X+         free(points);
  331. X+         }
  332. X      if (line->for_arrow) 
  333. X          draw_arrow(xx, yy, x, y, line->for_arrow, op);
  334. X      }
  335. X  
  336. X  draw_arc_box(line, op)
  337. X  F_line *line;
  338. X  int op;
  339. X***************
  340. X*** 400,411 ****
  341. X      int        xmin,xmax,ymin,ymax;
  342. X      int        pop, thick, style;
  343. X      float        val;
  344. X!     int        radius;
  345. X  
  346. X      point = line->points;
  347. X      style = line->style;
  348. X      val   = line->style_val;
  349. X-     thick = line->thickness;
  350. X      radius = line->pen;        /* hopefully temporary */
  351. X      pop = (op == ERASE)? background_color: foreground_color;
  352. X  
  353. X--- 340,355 ----
  354. X      int        xmin,xmax,ymin,ymax;
  355. X      int        pop, thick, style;
  356. X      float        val;
  357. X!     int        radius,diam;
  358. X!     XGCValues    gcv;
  359. X!     GC        gc;
  360. X  
  361. X+     thick = line->thickness;
  362. X+     if (thick == 0)
  363. X+         return;
  364. X      point = line->points;
  365. X      style = line->style;
  366. X      val   = line->style_val;
  367. X      radius = line->pen;        /* hopefully temporary */
  368. X      pop = (op == ERASE)? background_color: foreground_color;
  369. X  
  370. X***************
  371. X*** 423,438 ****
  372. X          else if (point->y > ymax)
  373. X              ymax = point->y;
  374. X          }
  375. X!     curve(canvas_pixwin, 0, radius, -radius, 0, 1, 1, 1, 
  376. X!         xmin+radius, ymin+radius, pop, thick, 0);
  377. X!     draw_line_segment(style, val, xmin, ymin+radius, xmin, ymax-radius+1, op, thick);
  378. X!     curve(canvas_pixwin, -radius, 0, 0, -radius, 1, 1, 1, 
  379. X!         xmin+radius, ymax-radius, pop, thick, 0);
  380. X!     draw_line_segment(style, val, xmin+radius, ymax, xmax-radius+1, ymax,op, thick);
  381. X!     curve(canvas_pixwin, 0, -radius, radius, 0, 1, 1, 1, 
  382. X!         xmax-radius, ymax-radius, pop, thick, 0);
  383. X!     draw_line_segment(style, val, xmax, ymax-radius, xmax, ymin+radius-1, op, thick);
  384. X!     curve(canvas_pixwin, radius, 0, 0, radius, 1, 1, 1, 
  385. X!         xmax-radius, ymin+radius, pop, thick, 0);
  386. X!     draw_line_segment(style, val, xmax-radius, ymin, xmin+radius-1, ymin, op, thick);
  387. X      }
  388. X--- 367,385 ----
  389. X          else if (point->y > ymax)
  390. X              ymax = point->y;
  391. X          }
  392. X!     set_line_stuff(thick,style,val,op);
  393. X!     gc = gccache[op];
  394. X!     diam = 2*radius;
  395. X!     XDrawArc(tool_d, canvas_pixwin, gc, xmin, ymin,
  396. X!             diam, diam, 90*64, 90*64);
  397. X!     XDrawLine(tool_d, canvas_pixwin, gc, xmin, ymin+radius, xmin, ymax-radius+1);
  398. X!     XDrawArc(tool_d, canvas_pixwin, gc, xmin, ymax-diam,
  399. X!             diam, diam, 180*64, 90*64);
  400. X!     XDrawLine(tool_d, canvas_pixwin, gc, xmin+radius, ymax, xmax-radius+1, ymax);
  401. X!     XDrawArc(tool_d, canvas_pixwin, gc, xmax-diam, ymax-diam,
  402. X!             diam, diam, 270*64, 90*64);
  403. X!     XDrawLine(tool_d, canvas_pixwin, gc, xmax, ymax-radius, xmax, ymin+radius-1);
  404. X!     XDrawArc(tool_d, canvas_pixwin, gc, xmax-diam, ymin,
  405. X!             diam, diam, 0*64, 90*64);
  406. X!     XDrawLine(tool_d, canvas_pixwin, gc, xmax-radius, ymin, xmin+radius-1, ymin);
  407. X      }
  408. END_OF_FILE
  409. if test 10337 -ne `wc -c <'draw.c.diff'`; then
  410.     echo shar: \"'draw.c.diff'\" unpacked with wrong size!
  411. fi
  412. # end of 'draw.c.diff'
  413. fi
  414. if test -f 'f2ps.c.diff' -a "${1}" != "-c" ; then 
  415.   echo shar: Will not clobber existing file \"'f2ps.c.diff'\"
  416. else
  417. echo shar: Extracting \"'f2ps.c.diff'\" \(7690 characters\)
  418. sed "s/^X//" >'f2ps.c.diff' <<'END_OF_FILE'
  419. X*** f2ps.c.p5    Fri Mar  2 13:06:01 1990
  420. X--- f2ps.c    Tue Mar 27 09:44:17 1990
  421. X***************
  422. X*** 410,417 ****
  423. X      p = l->points;
  424. X      q = p->next;
  425. X      if (q == NULL) { /* A single point line */
  426. X!         fprintf(tfp, "newpath %d %d moveto %d %d lineto stroke\n",
  427. X              p->x, p->y, p->x, p->y);
  428. X          return;
  429. X          }
  430. X      if (l->back_arrow)
  431. X--- 410,421 ----
  432. X      p = l->points;
  433. X      q = p->next;
  434. X      if (q == NULL) { /* A single point line */
  435. X!         if (l->thickness > 0)
  436. X!         fprintf(tfp, "newpath %d %d moveto %d %d lineto stroke\n",
  437. X              p->x, p->y, p->x, p->y);
  438. X+         else
  439. X+         fprintf(tfp, "newpath %d %d moveto %d %d lineto\n",
  440. X+             p->x, p->y, p->x, p->y);
  441. X          return;
  442. X          }
  443. X      if (l->back_arrow)
  444. X***************
  445. X*** 419,425 ****
  446. X              (float)p->y, l->back_arrow->ht, l->back_arrow->wid);
  447. X      set_style(l->style, l->style_val);
  448. X      fprintf(tfp, "%% Polyline\n");
  449. X!     if (l->type == T_ARC_BOX)
  450. X          {
  451. X          register int xmin,xmax,ymin,ymax;
  452. X  
  453. X--- 423,429 ----
  454. X              (float)p->y, l->back_arrow->ht, l->back_arrow->wid);
  455. X      set_style(l->style, l->style_val);
  456. X      fprintf(tfp, "%% Polyline\n");
  457. X!     if (l->type == T_ARC_BOX)    /* rounded-corner box */
  458. X          {
  459. X          register int xmin,xmax,ymin,ymax;
  460. X  
  461. X***************
  462. X*** 453,470 ****
  463. X          while (q->next != NULL) {
  464. X              p = q;
  465. X              q = q->next;
  466. X!             if (l->type == T_ARC_BOX)
  467. X!             {
  468. X!             fprintf(tfp," %d %d %d %d %d arcto 4 {pop} repeat",
  469. X!                     p->x,p->y,q->x,q->y,radius);
  470. X!             fprintf(tfp," 4 { pop } repeat");
  471. X!             }
  472. X!             else
  473. X!             fprintf(tfp, " %d %d lineto", p->x, p->y);
  474. X              }
  475. X          }
  476. X      if (l->type == T_POLYLINE)
  477. X!         fprintf(tfp, " %d %d lineto stroke\n", q->x, q->y);
  478. X      else
  479. X          {
  480. X          fprintf(tfp, " closepath ");
  481. X--- 457,472 ----
  482. X          while (q->next != NULL) {
  483. X              p = q;
  484. X              q = q->next;
  485. X!             fprintf(tfp, " %d %d lineto", p->x, p->y);
  486. X              }
  487. X          }
  488. X      if (l->type == T_POLYLINE)
  489. X!         {
  490. X!         if (l->thickness > 0)
  491. X!         fprintf(tfp, " %d %d lineto stroke\n", q->x, q->y);
  492. X!         else
  493. X!         fprintf(tfp, " %d %d lineto\n", q->x, q->y);
  494. X!         }
  495. X      else
  496. X          {
  497. X          fprintf(tfp, " closepath ");
  498. X***************
  499. X*** 474,484 ****
  500. X          fprintf(tfp, " gsave fill grestore ");
  501. X          set_areafill(NUMFILLPATS);    /* back to black line */
  502. X          }
  503. X!         fprintf(tfp, " stroke\n");
  504. X          }
  505. X  
  506. X      reset_style(l->style, l->style_val);
  507. X!     if (l->for_arrow)
  508. X          draw_arrow_head((float)p->x, (float)p->y, (float)q->x,
  509. X              (float)q->y, l->for_arrow->ht, l->for_arrow->wid);
  510. X      }
  511. X--- 476,487 ----
  512. X          fprintf(tfp, " gsave fill grestore ");
  513. X          set_areafill(NUMFILLPATS);    /* back to black line */
  514. X          }
  515. X!         if (l->thickness > 0)
  516. X!         fprintf(tfp, " stroke\n");
  517. X          }
  518. X  
  519. X      reset_style(l->style, l->style_val);
  520. X!     if (l->for_arrow && l->thickness > 0)
  521. X          draw_arrow_head((float)p->x, (float)p->y, (float)q->x,
  522. X              (float)q->y, l->for_arrow->ht, l->for_arrow->wid);
  523. X      }
  524. X***************
  525. X*** 508,514 ****
  526. X      a = s->controls;
  527. X      b = a->next;
  528. X      p = s->points;
  529. X!     if (s->back_arrow)
  530. X          draw_arrow_head(b->lx, b->ly, (float)p->x,
  531. X              (float)p->y, s->back_arrow->ht, s->back_arrow->wid);
  532. X  
  533. X--- 511,517 ----
  534. X      a = s->controls;
  535. X      b = a->next;
  536. X      p = s->points;
  537. X!     if (s->back_arrow && s->thickness > 0)
  538. X          draw_arrow_head(b->lx, b->ly, (float)p->x,
  539. X              (float)p->y, s->back_arrow->ht, s->back_arrow->wid);
  540. X  
  541. X***************
  542. X*** 532,541 ****
  543. X              set_areafill(NUMFILLPATS);    /* back to black for line */
  544. X              }
  545. X          }
  546. X!     fprintf(tfp, " stroke\n");
  547. X      reset_style(s->style, s->style_val);
  548. X  
  549. X!     if (s->for_arrow)
  550. X          draw_arrow_head(a->lx, a->ly, (float)p->x,
  551. X              (float)p->y, s->for_arrow->ht, s->for_arrow->wid);
  552. X      }
  553. X--- 535,545 ----
  554. X              set_areafill(NUMFILLPATS);    /* back to black for line */
  555. X              }
  556. X          }
  557. X!     if (s->thickness > 0)
  558. X!         fprintf(tfp, " stroke\n");
  559. X      reset_style(s->style, s->style_val);
  560. X  
  561. X!     if (s->for_arrow && s->thickness > 0)
  562. X          draw_arrow_head(a->lx, a->ly, (float)p->x,
  563. X              (float)p->y, s->for_arrow->ht, s->for_arrow->wid);
  564. X      }
  565. X***************
  566. X*** 565,571 ****
  567. X      set_linewidth(s->thickness);
  568. X      x3 = a = (x1 + c) / 2;
  569. X      y3 = b = (y1 + d) / 2;
  570. X!     if (s->back_arrow) {
  571. X          draw_arrow_head(c, d, x1, y1, s->back_arrow->ht, s->back_arrow->wid);
  572. X          }
  573. X      set_style(s->style, s->style_val);
  574. X--- 569,575 ----
  575. X      set_linewidth(s->thickness);
  576. X      x3 = a = (x1 + c) / 2;
  577. X      y3 = b = (y1 + d) / 2;
  578. X!     if (s->back_arrow && s->thickness > 0) {
  579. X          draw_arrow_head(c, d, x1, y1, s->back_arrow->ht, s->back_arrow->wid);
  580. X          }
  581. X      set_style(s->style, s->style_val);
  582. X***************
  583. X*** 600,612 ****
  584. X          fprintf(tfp, " gsave fill grestore\n");
  585. X          set_areafill(NUMFILLPATS);    /* back to black for line */
  586. X          }
  587. X!         fprintf(tfp, " stroke\n");
  588. X          }
  589. X      else {
  590. X!         fprintf(tfp, "\t%.3f %.3f lineto stroke\n", c, d);
  591. X          }
  592. X      reset_style(s->style, s->style_val);
  593. X!     if (s->for_arrow) {
  594. X          draw_arrow_head(x2, y2, c, d, s->for_arrow->ht,
  595. X                  s->for_arrow->wid);
  596. X          }
  597. X--- 604,621 ----
  598. X          fprintf(tfp, " gsave fill grestore\n");
  599. X          set_areafill(NUMFILLPATS);    /* back to black for line */
  600. X          }
  601. X!         if (s->thickness > 0)
  602. X!         fprintf(tfp, " stroke\n");
  603. X          }
  604. X      else {
  605. X!         if (s->thickness > 0)
  606. X!         fprintf(tfp, "\t%.3f %.3f lineto stroke\n", c, d);
  607. X!         else
  608. X!         fprintf(tfp, "\t%.3f %.3f lineto\n", c, d);
  609. X          }
  610. X      reset_style(s->style, s->style_val);
  611. X!     if (s->for_arrow && s->thickness > 0) 
  612. X!         {
  613. X          draw_arrow_head(x2, y2, c, d, s->for_arrow->ht,
  614. X                  s->for_arrow->wid);
  615. X          }
  616. X***************
  617. X*** 631,637 ****
  618. X          fprintf(tfp, " gsave fill grestore\n");
  619. X          set_areafill(NUMFILLPATS);    /* back to black for line */
  620. X          }
  621. X!     fprintf(tfp, " stroke\n");
  622. X      reset_style(e->style, e->style_val);
  623. X      }
  624. X  
  625. X--- 640,647 ----
  626. X          fprintf(tfp, " gsave fill grestore\n");
  627. X          set_areafill(NUMFILLPATS);    /* back to black for line */
  628. X          }
  629. X!     if (e->thickness > 0)
  630. X!         fprintf(tfp, " stroke\n");
  631. X      reset_style(e->style, e->style_val);
  632. X      }
  633. X  
  634. X***************
  635. X*** 725,735 ****
  636. X      else
  637. X          direction = a->direction;
  638. X      set_linewidth(a->thickness);
  639. X!     if (a->for_arrow) {
  640. X          arc_tangent(cx, cy, ex, ey, direction, &x, &y);
  641. X          draw_arrow_head(x, y, ex, ey, a->for_arrow->ht, a->for_arrow->wid);
  642. X          }
  643. X!     if (a->back_arrow) {
  644. X          arc_tangent(cx, cy, sx, sy, !direction, &x, &y);
  645. X          draw_arrow_head(x, y, sx, sy, a->back_arrow->ht, a->back_arrow->wid);
  646. X          }
  647. X--- 735,745 ----
  648. X      else
  649. X          direction = a->direction;
  650. X      set_linewidth(a->thickness);
  651. X!     if (a->for_arrow && a->thickness > 0) {
  652. X          arc_tangent(cx, cy, ex, ey, direction, &x, &y);
  653. X          draw_arrow_head(x, y, ex, ey, a->for_arrow->ht, a->for_arrow->wid);
  654. X          }
  655. X!     if (a->back_arrow && a->thickness > 0) {
  656. X          arc_tangent(cx, cy, sx, sy, !direction, &x, &y);
  657. X          draw_arrow_head(x, y, sx, sy, a->back_arrow->ht, a->back_arrow->wid);
  658. X          }
  659. X***************
  660. X*** 740,748 ****
  661. X      angle2 = atan2(ey-cy, ex-cx) * 180 / M_PI;
  662. X      /* direction = 1 -> Counterclockwise */
  663. X      set_style(a->style, a->style_val);
  664. X!     fprintf(tfp, "newpath %.3f %.3f %.3f %.3f %.3f %s stroke\n",
  665. X          cx, cy, radius, angle1, angle2,
  666. X          ((direction == 1) ? "arc" : "arcn"));
  667. X      reset_style(a->style, a->style_val);
  668. X      }
  669. X  
  670. X--- 750,766 ----
  671. X      angle2 = atan2(ey-cy, ex-cx) * 180 / M_PI;
  672. X      /* direction = 1 -> Counterclockwise */
  673. X      set_style(a->style, a->style_val);
  674. X!     fprintf(tfp, "newpath %.3f %.3f %.3f %.3f %.3f %s\n",
  675. X          cx, cy, radius, angle1, angle2,
  676. X          ((direction == 1) ? "arc" : "arcn"));
  677. X+     if (a->area_fill)
  678. X+         {
  679. X+         set_areafill(a->area_fill);
  680. X+         fprintf(tfp, " closepath gsave fill grestore\n");
  681. X+         set_areafill(NUMFILLPATS);    /* back to black for line */
  682. X+         }
  683. X+     if (a->thickness > 0)
  684. X+         fprintf(tfp," stroke\n");
  685. X      reset_style(a->style, a->style_val);
  686. X      }
  687. X  
  688. END_OF_FILE
  689. if test 7690 -ne `wc -c <'f2ps.c.diff'`; then
  690.     echo shar: \"'f2ps.c.diff'\" unpacked with wrong size!
  691. fi
  692. # end of 'f2ps.c.diff'
  693. fi
  694. if test -f 'printfonts.c.diff' -a "${1}" != "-c" ; then 
  695.   echo shar: Will not clobber existing file \"'printfonts.c.diff'\"
  696. else
  697. echo shar: Extracting \"'printfonts.c.diff'\" \(6160 characters\)
  698. sed "s/^X//" >'printfonts.c.diff' <<'END_OF_FILE'
  699. X*** printfonts.c.p5    Fri Mar  9 16:48:55 1990
  700. X--- printfonts.c    Tue Mar 20 17:42:28 1990
  701. X***************
  702. X*** 34,44 ****
  703. X  
  704. X  static Arg    fontmenu_args[] =
  705. X  {
  706. X!     /* 0 */{ XtNx, (XtArgVal) 0 },
  707. X!     /* 1 */{ XtNy, (XtArgVal) 0 },
  708. X!     /* 2 */{ XtNwidth, (XtArgVal) 0 },
  709. X!     /* 3 */{ XtNheight, (XtArgVal) 0 },
  710. X!     /* 4 */{ XtNvSpace, (XtArgVal) 1 },
  711. X  };
  712. X  
  713. X  extern void fontpane_select();
  714. X--- 34,40 ----
  715. X  
  716. X  static Arg    fontmenu_args[] =
  717. X  {
  718. X!     { XtNvSpace, (XtArgVal) 1 },
  719. X  };
  720. X  
  721. X  extern void fontpane_select();
  722. X***************
  723. X*** 51,90 ****
  724. X  
  725. X  static Arg      main_pane_args[] =
  726. X  {
  727. X!     /* 0 */ { XtNx, (XtArgVal)10 },
  728. X!     /* 1 */ { XtNy, (XtArgVal)30 },
  729. X!     /* 2 */ { XtNlabel, (XtArgVal)"        " },
  730. X!     /* 3 */ { XtNwidth, (XtArgVal) FONT_PANE_WIDTH },
  731. X  };
  732. X  
  733. X  static Arg      pane_args[] =
  734. X  {
  735. X!     /* 0 */ { XtNx, (XtArgVal) 0 },
  736. X!     /* 1 */ { XtNy, (XtArgVal) 0 },
  737. X!     /* 2 */ { XtNwidth, (XtArgVal) FONT_PANE_WIDTH },
  738. X!     /* 3 */ { XtNheight, (XtArgVal) 20 },
  739. X!     /* 4 */ { XtNcallback, (XtArgVal)pane_callbacks },
  740. X!     /* 5 */ { XtNbitmap, (XtArgVal) NULL },
  741. X!     /* 6 */ { XtNinternalWidth, (XtArgVal) 0 },    /* space between pixmap and edge */
  742. X!     /* 7 */ { XtNinternalHeight, (XtArgVal) 0 },
  743. X!     /* 8 */ { XtNresize, (XtArgVal) FALSE },    /* don't allow resize */
  744. X  };
  745. X  
  746. X  static Arg      psfont_args[] =
  747. X  {
  748. X!     /* 0 */ { XtNx, (XtArgVal)0 },
  749. X!     /* 1 */ { XtNy, (XtArgVal)0 },
  750. X!     /* 2 */ { XtNwidth, (XtArgVal) FONT_PANE_WIDTH },
  751. X!     /* 3 */ { XtNheight, (XtArgVal) MSG_HEIGHT },    /* same height as message panel */
  752. X!     /* 4 */ { XtNfromHoriz, (XtArgVal) NULL },    /* left side of main form */
  753. X!     /* 5 */ { XtNhorizDistance, (XtArgVal) SWITCH_ICON_SPACING },
  754. X!     /* 6 */ { XtNfromVert, (XtArgVal) NULL },
  755. X!     /* 7 */ { XtNvertDistance, (XtArgVal) 1 },    /* dist from canvas_sw window */
  756. X!     /* 8 */ { XtNbitmap, (XtArgVal) NULL },
  757. X!     /* 9 */ { XtNinternalWidth, (XtArgVal) 0 },    /* space between pixmap and edge */
  758. X!     /*10 */ { XtNinternalHeight, (XtArgVal) 0 },
  759. X!     /*11 */ { XtNleft, (XtArgVal) XtChainLeft },
  760. X!     /*12 */ { XtNright, (XtArgVal) XtChainLeft },
  761. X  };
  762. X  
  763. X  static    TOOL    fontpanes;
  764. X--- 47,80 ----
  765. X  
  766. X  static Arg      main_pane_args[] =
  767. X  {
  768. X!     /* 0 */ { XtNlabel, (XtArgVal)"        " },
  769. X!     /* 1 */ { XtNwidth, (XtArgVal) FONT_PANE_WIDTH },
  770. X  };
  771. X  
  772. X  static Arg      pane_args[] =
  773. X  {
  774. X!     /* 0 */ { XtNwidth, (XtArgVal) FONT_PANE_WIDTH },
  775. X!     /* 1 */ { XtNheight, (XtArgVal) 20 },
  776. X!     /* 2 */ { XtNcallback, (XtArgVal)pane_callbacks },
  777. X!     /* 3 */ { XtNbitmap, (XtArgVal) NULL },
  778. X!     /* 4 */ { XtNinternalWidth, (XtArgVal) 0 },    /* space between pixmap and edge */
  779. X!     /* 5 */ { XtNinternalHeight, (XtArgVal) 0 },
  780. X!     /* 6 */ { XtNresize, (XtArgVal) FALSE },    /* don't allow resize */
  781. X  };
  782. X  
  783. X  static Arg      psfont_args[] =
  784. X  {
  785. X!     /* 0 */ { XtNwidth, (XtArgVal) FONT_PANE_WIDTH },
  786. X!     /* 1 */ { XtNheight, (XtArgVal) MSG_HEIGHT },    /* same height as message panel */
  787. X!     /* 2 */ { XtNfromHoriz, (XtArgVal) NULL },    /* left side of main form */
  788. X!     /* 3 */ { XtNhorizDistance, (XtArgVal) 1 },
  789. X!     /* 4 */ { XtNfromVert, (XtArgVal) NULL },
  790. X!     /* 5 */ { XtNvertDistance, (XtArgVal) -1 },    /* dist from canvas_sw window */
  791. X!     /* 6 */ { XtNbitmap, (XtArgVal) NULL },
  792. X!     /* 8 */ { XtNinternalWidth, (XtArgVal) 0 },    /* space between pixmap and edge */
  793. X!     /* 8 */ { XtNinternalHeight, (XtArgVal) 0 },
  794. X!     /* 9 */ { XtNleft, (XtArgVal) XtChainLeft },
  795. X!     /*10 */ { XtNright, (XtArgVal) XtChainLeft },
  796. X  };
  797. X  
  798. X  static    TOOL    fontpanes;
  799. X***************
  800. X*** 118,124 ****
  801. X          mi = &fontmenu_items[i];
  802. X      }
  803. X      
  804. X!     main_pane_args[2].value = (XtArgVal)"Printer Fonts";
  805. X      title = XtCreateManagedWidget("title", labelWidgetClass,
  806. X                     fontpanes, main_pane_args, XtNumber(main_pane_args));
  807. X  
  808. X--- 108,114 ----
  809. X          mi = &fontmenu_items[i];
  810. X      }
  811. X      
  812. X!     main_pane_args[0].value = (XtArgVal)"Printer Fonts";
  813. X      title = XtCreateManagedWidget("title", labelWidgetClass,
  814. X                     fontpanes, main_pane_args, XtNumber(main_pane_args));
  815. X  
  816. X***************
  817. X*** 143,149 ****
  818. X      /* Now set up the font indicator window */
  819. X  
  820. X      /* position */
  821. X!     psfont_args[6].value = (XtArgVal)canvas_sw;    /* just below the canvas window */
  822. X      psfont = XtCreateManagedWidget("font_indicator", labelWidgetClass, tool,
  823. X          psfont_args, XtNumber(psfont_args));
  824. X      return (1);
  825. X--- 133,139 ----
  826. X      /* Now set up the font indicator window */
  827. X  
  828. X      /* position */
  829. X!     psfont_args[4].value = (XtArgVal)canvas_sw;    /* just below the canvas window */
  830. X      psfont = XtCreateManagedWidget("font_indicator", labelWidgetClass, tool,
  831. X          psfont_args, XtNumber(psfont_args));
  832. X      return (1);
  833. X***************
  834. X*** 161,174 ****
  835. X      for (i=0; i<NUMFONTS; i++)
  836. X          font_menu_bitmaps[i] = XCreateBitmapFromData(tool_d,XtWindow(psfont),
  837. X          font_menu_bits[i], FONT_PANE_WIDTH, FONT_PANE_HEIGHT);
  838. X!     psfont_args[8].value = (XtArgVal) font_menu_bitmaps[0];
  839. X!     XtSetValues(psfont, &psfont_args[8], 1);    /* show default font in window */
  840. X  
  841. X      /* Store the bitmaps in the menu panes */
  842. X      for (i=0; i< NUMFONTS; i++)
  843. X          {
  844. X!         pane_args[5].value = (XtArgVal) font_menu_bitmaps[i];
  845. X!         XtSetValues(fontpane[i], &pane_args[5], 1);    /* bitmap */
  846. X          }
  847. X      }
  848. X  
  849. X--- 151,164 ----
  850. X      for (i=0; i<NUMFONTS; i++)
  851. X          font_menu_bitmaps[i] = XCreateBitmapFromData(tool_d,XtWindow(psfont),
  852. X          font_menu_bits[i], FONT_PANE_WIDTH, FONT_PANE_HEIGHT);
  853. X!     psfont_args[6].value = (XtArgVal) font_menu_bitmaps[0];
  854. X!     XtSetValues(psfont, &psfont_args[6], 1);    /* show default font in window */
  855. X  
  856. X      /* Store the bitmaps in the menu panes */
  857. X      for (i=0; i< NUMFONTS; i++)
  858. X          {
  859. X!         pane_args[3].value = (XtArgVal) font_menu_bitmaps[i];
  860. X!         XtSetValues(fontpane[i], &pane_args[3], 1);    /* bitmap */
  861. X          }
  862. X      }
  863. X  
  864. X***************
  865. X*** 198,204 ****
  866. X      font_button = (int) mi->info;
  867. X      put_msg("Font: %s",font_name);
  868. X      /* put image of font in indicator window */
  869. X!     psfont_args[8].value = (XtArgVal) font_menu_bitmaps[font_button];
  870. X!     XtSetValues(psfont, &psfont_args[8], 1);
  871. X      XtPopdown(fontmenu);
  872. X      }
  873. X--- 188,194 ----
  874. X      font_button = (int) mi->info;
  875. X      put_msg("Font: %s",font_name);
  876. X      /* put image of font in indicator window */
  877. X!     psfont_args[6].value = (XtArgVal) font_menu_bitmaps[font_button];
  878. X!     XtSetValues(psfont, &psfont_args[6], 1);
  879. X      XtPopdown(fontmenu);
  880. X      }
  881. END_OF_FILE
  882. if test 6160 -ne `wc -c <'printfonts.c.diff'`; then
  883.     echo shar: \"'printfonts.c.diff'\" unpacked with wrong size!
  884. fi
  885. # end of 'printfonts.c.diff'
  886. fi
  887. if test -f 'scale.c.diff' -a "${1}" != "-c" ; then 
  888.   echo shar: Will not clobber existing file \"'scale.c.diff'\"
  889. else
  890. echo shar: Extracting \"'scale.c.diff'\" \(6874 characters\)
  891. sed "s/^X//" >'scale.c.diff' <<'END_OF_FILE'
  892. X*** scale.c.p5    Tue Jan 16 17:21:04 1990
  893. X--- scale.c    Thu Mar 15 15:28:52 1990
  894. X***************
  895. X*** 34,40 ****
  896. X  
  897. X  static enum        {WEST, NORTH, EAST, SOUTH, CORNER} side;
  898. X  static int        save_coord;
  899. X! static F_compound    *compound;
  900. X  static double        cosa, sina;
  901. X  static int        fromx, fromy;
  902. X              init_scale_compound();
  903. X--- 34,40 ----
  904. X  
  905. X  static enum        {WEST, NORTH, EAST, SOUTH, CORNER} side;
  906. X  static int        save_coord;
  907. X! static F_compound    *cmpnd;
  908. X  static double        cosa, sina;
  909. X  static int        fromx, fromy;
  910. X              init_scale_compound();
  911. X***************
  912. X*** 55,71 ****
  913. X  {
  914. X      double    dx, dy, l;
  915. X      
  916. X!     if ((compound = compound_point_search(x, y, TOLERANCE, &cur_x,
  917. X                            &cur_y)) != NULL)
  918. X      {
  919. X!         if (compound->nwcorner.x == cur_x) 
  920. X!             fix_x = compound->secorner.x;
  921. X          else
  922. X!             fix_x = compound->nwcorner.x;
  923. X!         if (compound->nwcorner.y == cur_y) 
  924. X!             fix_y = compound->secorner.y;
  925. X          else
  926. X!             fix_y = compound->nwcorner.y;
  927. X          
  928. X          side = CORNER;
  929. X          dx = cur_x - fix_x;  dy = cur_y - fix_y;
  930. X--- 55,71 ----
  931. X  {
  932. X      double    dx, dy, l;
  933. X      
  934. X!     if ((cmpnd = compound_point_search(x, y, TOLERANCE, &cur_x,
  935. X                            &cur_y)) != NULL)
  936. X      {
  937. X!         if (cmpnd->nwcorner.x == cur_x) 
  938. X!             fix_x = cmpnd->secorner.x;
  939. X          else
  940. X!             fix_x = cmpnd->nwcorner.x;
  941. X!         if (cmpnd->nwcorner.y == cur_y) 
  942. X!             fix_y = cmpnd->secorner.y;
  943. X          else
  944. X!             fix_y = cmpnd->nwcorner.y;
  945. X          
  946. X          side = CORNER;
  947. X          dx = cur_x - fix_x;  dy = cur_y - fix_y;
  948. X***************
  949. X*** 74,82 ****
  950. X          
  951. X          fromx = cur_x;  fromy = cur_y;
  952. X          win_setmouseposition(canvas_swfd, cur_x, cur_y);
  953. X!         draw_compoundbox(compound, INV_PAINT);
  954. X!         draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT, 1);
  955. X!         set_latestcompound(compound);
  956. X          canvas_locmove_proc = elastic_compoundbox;
  957. X          canvas_middlebut_proc = prescale_compound;
  958. X          canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  959. X--- 74,82 ----
  960. X          
  961. X          fromx = cur_x;  fromy = cur_y;
  962. X          win_setmouseposition(canvas_swfd, cur_x, cur_y);
  963. X!         draw_compoundbox(cmpnd, INV_PAINT);
  964. X!         draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
  965. X!         set_latestcompound(cmpnd);
  966. X          canvas_locmove_proc = elastic_compoundbox;
  967. X          canvas_middlebut_proc = prescale_compound;
  968. X          canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  969. X***************
  970. X*** 84,100 ****
  971. X          set_temp_cursor(&null_cursor);
  972. X          win_setmouseposition(canvas_swfd, x, y);
  973. X      }
  974. X!     else if ((compound = compound_search(x, y, TOLERANCE, &cur_x, &cur_y))
  975. X           != NULL )
  976. X      {
  977. X          /* figure out which side the cursor is close to. */
  978. X!         if (compound->nwcorner.x == cur_x)
  979. X              side = WEST;
  980. X!         else if (compound->nwcorner.y == cur_y)
  981. X              side = NORTH;
  982. X!         else if (compound->secorner.x == cur_x)
  983. X              side = EAST;
  984. X!         else if (compound->secorner.y == cur_y)
  985. X              side = SOUTH;
  986. X          else
  987. X              return;
  988. X--- 84,100 ----
  989. X          set_temp_cursor(&null_cursor);
  990. X          win_setmouseposition(canvas_swfd, x, y);
  991. X      }
  992. X!     else if ((cmpnd = compound_search(x, y, TOLERANCE, &cur_x, &cur_y))
  993. X           != NULL )
  994. X      {
  995. X          /* figure out which side the cursor is close to. */
  996. X!         if (cmpnd->nwcorner.x == cur_x)
  997. X              side = WEST;
  998. X!         else if (cmpnd->nwcorner.y == cur_y)
  999. X              side = NORTH;
  1000. X!         else if (cmpnd->secorner.x == cur_x)
  1001. X              side = EAST;
  1002. X!         else if (cmpnd->secorner.y == cur_y)
  1003. X              side = SOUTH;
  1004. X          else
  1005. X              return;
  1006. X***************
  1007. X*** 103,119 ****
  1008. X          switch (side) {
  1009. X          case WEST:
  1010. X          case NORTH:
  1011. X!             fix_x = compound->secorner.x;
  1012. X!             fix_y = compound->secorner.y;
  1013. X!             cur_x = compound->nwcorner.x;
  1014. X!             cur_y = compound->nwcorner.y;
  1015. X              break;
  1016. X          case EAST:
  1017. X          case SOUTH:
  1018. X!             fix_x = compound->nwcorner.x;
  1019. X!             fix_y = compound->nwcorner.y;
  1020. X!             cur_x = compound->secorner.x;
  1021. X!             cur_y = compound->secorner.y;
  1022. X              break;
  1023. X          }
  1024. X          
  1025. X--- 103,119 ----
  1026. X          switch (side) {
  1027. X          case WEST:
  1028. X          case NORTH:
  1029. X!             fix_x = cmpnd->secorner.x;
  1030. X!             fix_y = cmpnd->secorner.y;
  1031. X!             cur_x = cmpnd->nwcorner.x;
  1032. X!             cur_y = cmpnd->nwcorner.y;
  1033. X              break;
  1034. X          case EAST:
  1035. X          case SOUTH:
  1036. X!             fix_x = cmpnd->nwcorner.x;
  1037. X!             fix_y = cmpnd->nwcorner.y;
  1038. X!             cur_x = cmpnd->secorner.x;
  1039. X!             cur_y = cmpnd->secorner.y;
  1040. X              break;
  1041. X          }
  1042. X          
  1043. X***************
  1044. X*** 131,139 ****
  1045. X          }
  1046. X          /*  erase the compound box. */
  1047. X          win_setmouseposition(canvas_swfd, cur_x, cur_y);
  1048. X!         draw_compoundbox(compound, INV_PAINT);
  1049. X!         draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT, 1);
  1050. X!         set_latestcompound(compound);
  1051. X          canvas_locmove_proc = elastic_compoundbox;
  1052. X          canvas_middlebut_proc = prescale_compound;
  1053. X          canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  1054. X--- 131,139 ----
  1055. X          }
  1056. X          /*  erase the compound box. */
  1057. X          win_setmouseposition(canvas_swfd, cur_x, cur_y);
  1058. X!         draw_compoundbox(cmpnd, INV_PAINT);
  1059. X!         draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
  1060. X!         set_latestcompound(cmpnd);
  1061. X          canvas_locmove_proc = elastic_compoundbox;
  1062. X          canvas_middlebut_proc = prescale_compound;
  1063. X          canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  1064. X***************
  1065. X*** 147,156 ****
  1066. X  elastic_compoundbox(x, y)
  1067. X  int    x, y;
  1068. X  {
  1069. X!     draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT, 1);
  1070. X      compute_adjustposition(x, y);
  1071. X      win_setmouseposition(canvas_swfd, cur_x, cur_y);
  1072. X!     draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT, 1);
  1073. X      }
  1074. X  
  1075. X  compute_adjustposition(x, y)
  1076. X--- 147,156 ----
  1077. X  elastic_compoundbox(x, y)
  1078. X  int    x, y;
  1079. X  {
  1080. X!     draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
  1081. X      compute_adjustposition(x, y);
  1082. X      win_setmouseposition(canvas_swfd, cur_x, cur_y);
  1083. X!     draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
  1084. X      }
  1085. X  
  1086. X  compute_adjustposition(x, y)
  1087. X***************
  1088. X*** 188,203 ****
  1089. X  {
  1090. X      float        scalex, scaley;
  1091. X  
  1092. X!     draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT, 1);
  1093. X      compute_adjustposition(x, y);
  1094. X!     erase_compound(compound);
  1095. X  
  1096. X      scalex = ((float) (cur_x - fix_x)) / (fromx - fix_x);
  1097. X      scaley = ((float) (cur_y - fix_y)) / (fromy - fix_y);
  1098. X!     scale_compound(compound, scalex, scaley, fix_x, fix_y);
  1099. X  
  1100. X!     draw_compound(compound);
  1101. X!     draw_compoundbox(compound, INV_PAINT);
  1102. X      last_position.x = fromx;
  1103. X      last_position.y = fromy;
  1104. X      new_position.x = cur_x;
  1105. X--- 188,203 ----
  1106. X  {
  1107. X      float        scalex, scaley;
  1108. X  
  1109. X!     draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
  1110. X      compute_adjustposition(x, y);
  1111. X!     erase_compound(cmpnd);
  1112. X  
  1113. X      scalex = ((float) (cur_x - fix_x)) / (fromx - fix_x);
  1114. X      scaley = ((float) (cur_y - fix_y)) / (fromy - fix_y);
  1115. X!     scale_compound(cmpnd, scalex, scaley, fix_x, fix_y);
  1116. X  
  1117. X!     draw_compound(cmpnd);
  1118. X!     draw_compoundbox(cmpnd, INV_PAINT);
  1119. X      last_position.x = fromx;
  1120. X      last_position.y = fromy;
  1121. X      new_position.x = cur_x;
  1122. X***************
  1123. X*** 215,221 ****
  1124. X      }
  1125. X      clean_up();
  1126. X      set_action_object(F_SCALE, O_COMPOUND);
  1127. X!     set_latestcompound(compound);
  1128. X      set_modifiedflag();
  1129. X      scale_compound_selected();
  1130. X      }
  1131. X--- 215,221 ----
  1132. X      }
  1133. X      clean_up();
  1134. X      set_action_object(F_SCALE, O_COMPOUND);
  1135. X!     set_latestcompound(cmpnd);
  1136. X      set_modifiedflag();
  1137. X      scale_compound_selected();
  1138. X      }
  1139. END_OF_FILE
  1140. if test 6874 -ne `wc -c <'scale.c.diff'`; then
  1141.     echo shar: \"'scale.c.diff'\" unpacked with wrong size!
  1142. fi
  1143. # end of 'scale.c.diff'
  1144. fi
  1145. if test -f 'spline.c.diff' -a "${1}" != "-c" ; then 
  1146.   echo shar: Will not clobber existing file \"'spline.c.diff'\"
  1147. else
  1148. echo shar: Extracting \"'spline.c.diff'\" \(6812 characters\)
  1149. sed "s/^X//" >'spline.c.diff' <<'END_OF_FILE'
  1150. X*** spline.c.p5    Tue Jan 16 17:21:08 1990
  1151. X--- spline.c    Fri Mar 16 17:06:23 1990
  1152. X***************
  1153. X*** 22,28 ****
  1154. X  extern            null_proc();
  1155. X  extern            set_popupmenu();
  1156. X  
  1157. X! extern int        cur_line_style, line_thickness;
  1158. X  extern float        cur_styleval;
  1159. X  extern int        cur_color;
  1160. X  extern int        cur_areafill;
  1161. X--- 22,28 ----
  1162. X  extern            null_proc();
  1163. X  extern            set_popupmenu();
  1164. X  
  1165. X! extern int        line_style, line_thickness;
  1166. X  extern float        cur_styleval;
  1167. X  extern int        cur_color;
  1168. X  extern int        cur_areafill;
  1169. X***************
  1170. X*** 35,42 ****
  1171. X  extern int        arrow_ht, arrow_wid;
  1172. X  extern F_compound    objects;
  1173. X  extern int        num_point;
  1174. X- extern int        DEBUG;
  1175. X  extern F_point        *first_point, *cur_point;
  1176. X  
  1177. X  int            create_splineobject();
  1178. X              init_spline_drawing();
  1179. X--- 35,42 ----
  1180. X  extern int        arrow_ht, arrow_wid;
  1181. X  extern F_compound    objects;
  1182. X  extern int        num_point;
  1183. X  extern F_point        *first_point, *cur_point;
  1184. X+ extern appresStruct    appres;
  1185. X  
  1186. X  int            create_splineobject();
  1187. X              init_spline_drawing();
  1188. X***************
  1189. X*** 70,76 ****
  1190. X      draw_elasticline();
  1191. X      if (num_point <= 2) {
  1192. X          pw_vector(canvas_pixwin, first_point->x, first_point->y,
  1193. X!             cur_point->x, cur_point->y, PAINT, 0);
  1194. X          if (num_point == 1) free((char*)cur_point);
  1195. X          free((char*)first_point);
  1196. X          draw_spline_selected();
  1197. X--- 70,76 ----
  1198. X      draw_elasticline();
  1199. X      if (num_point <= 2) {
  1200. X          pw_vector(canvas_pixwin, first_point->x, first_point->y,
  1201. X!             cur_point->x, cur_point->y, PAINT, 1, SOLID_LINE, 0.0);
  1202. X          if (num_point == 1) free((char*)cur_point);
  1203. X          free((char*)first_point);
  1204. X          draw_spline_selected();
  1205. X***************
  1206. X*** 77,83 ****
  1207. X          return;
  1208. X          }
  1209. X      Spline_malloc(spline);
  1210. X!     spline->style = cur_line_style;
  1211. X      spline->thickness = line_thickness;
  1212. X      spline->style_val = cur_styleval;
  1213. X      spline->color = cur_color;
  1214. X--- 77,83 ----
  1215. X          return;
  1216. X          }
  1217. X      Spline_malloc(spline);
  1218. X!     spline->style = line_style;
  1219. X      spline->thickness = line_thickness;
  1220. X      spline->style_val = cur_styleval;
  1221. X      spline->color = cur_color;
  1222. X***************
  1223. X*** 89,95 ****
  1224. X      spline->next = NULL; 
  1225. X      cur_x = cur_y = fix_x = fix_y = 0; /* used in draw_movingpoint */
  1226. X      draw_movingpoint(spline->points, INV_PAINT); /* erase control vector */
  1227. X-     pw_batch_on(canvas_pixwin);
  1228. X      if (cur_command == F_CLOSED_SPLINE) {
  1229. X          spline->type = T_CLOSED_NORMAL;
  1230. X          spline->for_arrow = NULL;
  1231. X--- 89,94 ----
  1232. X***************
  1233. X*** 98,104 ****
  1234. X          /* The current area fill color will be saved in the object if 
  1235. X             fill_mode is != 0, but the method presently used to draw
  1236. X             the spline doesn't easily lend itself to area fill,
  1237. X!            so it is not filled.
  1238. X             The spline is drawn in sections that aren't adjacent, 
  1239. X             and have overlapping sections. */
  1240. X          spline->area_fill = fill_mode? cur_areafill : 0;
  1241. X--- 97,103 ----
  1242. X          /* The current area fill color will be saved in the object if 
  1243. X             fill_mode is != 0, but the method presently used to draw
  1244. X             the spline doesn't easily lend itself to area fill,
  1245. X!            so it is drawn not filled.
  1246. X             The spline is drawn in sections that aren't adjacent, 
  1247. X             and have overlapping sections. */
  1248. X          spline->area_fill = fill_mode? cur_areafill : 0;
  1249. X***************
  1250. X*** 118,128 ****
  1251. X          spline->type = T_OPEN_NORMAL;
  1252. X          draw_open_spline(spline, PAINT);
  1253. X          }
  1254. X!     pw_batch_off(canvas_pixwin);
  1255. X!     if (DEBUG) {
  1256. X          int        xmin, ymin, xmax, ymax;
  1257. X          spline_bound(spline, &xmin, &ymin, &xmax, &ymax);
  1258. X!         draw_rectbox(xmin, ymin, xmax, ymax, PAINT, 1);
  1259. X          }
  1260. X      clean_up();
  1261. X      insert_spline(&objects.splines, spline);
  1262. X--- 117,126 ----
  1263. X          spline->type = T_OPEN_NORMAL;
  1264. X          draw_open_spline(spline, PAINT);
  1265. X          }
  1266. X!     if (appres.DEBUG) {
  1267. X          int        xmin, ymin, xmax, ymax;
  1268. X          spline_bound(spline, &xmin, &ymin, &xmax, &ymax);
  1269. X!         draw_rectbox(xmin, ymin, xmax, ymax, PAINT);
  1270. X          }
  1271. X      clean_up();
  1272. X      insert_spline(&objects.splines, spline);
  1273. X***************
  1274. X*** 152,158 ****
  1275. X          draw_arrow((int)x2, (int)y2, (int)x1, (int)y1, 
  1276. X          spline->back_arrow, op);
  1277. X      pw_vector(canvas_pixwin, (int)x1, (int)y1, round(cx1), 
  1278. X!         round(cy1), op, spline->thickness);
  1279. X  
  1280. X      for (p = p->next; p != NULL; p = p->next) {
  1281. X          x1 = x2;  y1 = y2;
  1282. X--- 150,157 ----
  1283. X          draw_arrow((int)x2, (int)y2, (int)x1, (int)y1, 
  1284. X          spline->back_arrow, op);
  1285. X      pw_vector(canvas_pixwin, (int)x1, (int)y1, round(cx1), 
  1286. X!         round(cy1), op, spline->thickness, 
  1287. X!         spline->style, spline->style_val);
  1288. X  
  1289. X      for (p = p->next; p != NULL; p = p->next) {
  1290. X          x1 = x2;  y1 = y2;
  1291. X***************
  1292. X*** 160,171 ****
  1293. X          cx4 = (x1 + x2) / 2; cy4 = (y1 + y2) / 2;
  1294. X          cx3 = (x1 + cx4) / 2; cy3 = (y1 + cy4) / 2;
  1295. X          quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4, op,
  1296. X!             spline->thickness);
  1297. X          cx1 = cx4;  cy1 = cy4;
  1298. X          cx2 = (cx1 + x2) / 2;  cy2 = (cy1 + y2) / 2;
  1299. X          }
  1300. X      pw_vector(canvas_pixwin, round(cx1), round(cy1), 
  1301. X!         (int)x2, (int)y2, op, spline->thickness);
  1302. X      if (spline->for_arrow) /*  forward arrow  */
  1303. X          draw_arrow((int)x1, (int)y1, (int)x2, (int)y2, 
  1304. X          spline->for_arrow, op);
  1305. X--- 159,171 ----
  1306. X          cx4 = (x1 + x2) / 2; cy4 = (y1 + y2) / 2;
  1307. X          cx3 = (x1 + cx4) / 2; cy3 = (y1 + cy4) / 2;
  1308. X          quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4, op,
  1309. X!             spline->thickness, spline->style, spline->style_val);
  1310. X          cx1 = cx4;  cy1 = cy4;
  1311. X          cx2 = (cx1 + x2) / 2;  cy2 = (cy1 + y2) / 2;
  1312. X          }
  1313. X      pw_vector(canvas_pixwin, round(cx1), round(cy1), 
  1314. X!         (int)x2, (int)y2, op, spline->thickness, 
  1315. X!         spline->style, spline->style_val);
  1316. X      if (spline->for_arrow) /*  forward arrow  */
  1317. X          draw_arrow((int)x1, (int)y1, (int)x2, (int)y2, 
  1318. X          spline->for_arrow, op);
  1319. X***************
  1320. X*** 192,198 ****
  1321. X          cx4 = (x1 + x2) / 2;   cy4 = (y1 + y2) / 2;
  1322. X          cx3 = (x1 + cx4) / 2;  cy3 = (y1 + cy4) / 2;
  1323. X          quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4, op, 
  1324. X!             spline->thickness);
  1325. X          cx1 = cx4;  cy1 = cy4;
  1326. X          cx2 = (cx1 + x2) / 2;  cy2 = (cy1 + y2) / 2;
  1327. X          }
  1328. X--- 192,198 ----
  1329. X          cx4 = (x1 + x2) / 2;   cy4 = (y1 + y2) / 2;
  1330. X          cx3 = (x1 + cx4) / 2;  cy3 = (y1 + cy4) / 2;
  1331. X          quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4, op, 
  1332. X!             spline->thickness, spline->style, spline->style_val);
  1333. X          cx1 = cx4;  cy1 = cy4;
  1334. X          cx2 = (cx1 + x2) / 2;  cy2 = (cy1 + y2) / 2;
  1335. X          }
  1336. X***************
  1337. X*** 202,206 ****
  1338. X      cx4 = (x1 + x2) / 2;   cy4 = (y1 + y2) / 2;
  1339. X      cx3 = (x1 + cx4) / 2;  cy3 = (y1 + cy4) / 2;
  1340. X      quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4, op, 
  1341. X!             spline->thickness);
  1342. X      }
  1343. X--- 202,206 ----
  1344. X      cx4 = (x1 + x2) / 2;   cy4 = (y1 + y2) / 2;
  1345. X      cx3 = (x1 + cx4) / 2;  cy3 = (y1 + cy4) / 2;
  1346. X      quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4, op, 
  1347. X!             spline->thickness, spline->style, spline->style_val);
  1348. X      }
  1349. END_OF_FILE
  1350. if test 6812 -ne `wc -c <'spline.c.diff'`; then
  1351.     echo shar: \"'spline.c.diff'\" unpacked with wrong size!
  1352. fi
  1353. # end of 'spline.c.diff'
  1354. fi
  1355. if test -f 'xtra.c.diff' -a "${1}" != "-c" ; then 
  1356.   echo shar: Will not clobber existing file \"'xtra.c.diff'\"
  1357. else
  1358. echo shar: Extracting \"'xtra.c.diff'\" \(7317 characters\)
  1359. sed "s/^X//" >'xtra.c.diff' <<'END_OF_FILE'
  1360. X*** xtra.c.p5    Mon Mar 12 13:26:43 1990
  1361. X--- xtra.c    Mon Mar 26 15:38:54 1990
  1362. X***************
  1363. X*** 11,20 ****
  1364. X  #include "resources.h"
  1365. X  #include "paintop.h"
  1366. X  #include "font.h"
  1367. X  
  1368. X! extern int cur_thickness[];
  1369. X! extern PIX_FONT lookfont();
  1370. X  
  1371. X  /* print "string" in window "w" using font number "font" and size "size" */
  1372. X  
  1373. X  pw_text(w, x, y, op, font, size, string)
  1374. X--- 11,22 ----
  1375. X  #include "resources.h"
  1376. X  #include "paintop.h"
  1377. X  #include "font.h"
  1378. X+ #include "object.h"
  1379. X  
  1380. X! extern int        gc_thickness[], gc_line_style[];
  1381. X  
  1382. X+ extern PIX_FONT        lookfont();
  1383. X+ 
  1384. X  /* print "string" in window "w" using font number "font" and size "size" */
  1385. X  
  1386. X  pw_text(w, x, y, op, font, size, string)
  1387. X***************
  1388. X*** 22,33 ****
  1389. X  int x, y, op, font, size;
  1390. X  char *string;
  1391. X      {
  1392. X!     if (cur_gcfont[op] != font || cur_gcfontsize[op] != size)
  1393. X          {
  1394. X          canvas_font = lookfont(font,size);
  1395. X          XSetFont(tool_d, gccache[op], canvas_font->fid);
  1396. X!         cur_gcfont[op] = font;
  1397. X!         cur_gcfontsize[op] = size;
  1398. X          }
  1399. X      XDrawString(tool_d, w, gccache[op], x, y, string, strlen(string));
  1400. X      }
  1401. X--- 24,35 ----
  1402. X  int x, y, op, font, size;
  1403. X  char *string;
  1404. X      {
  1405. X!     if (gc_font[op] != font || gc_fontsize[op] != size)
  1406. X          {
  1407. X          canvas_font = lookfont(font,size);
  1408. X          XSetFont(tool_d, gccache[op], canvas_font->fid);
  1409. X!         gc_font[op] = font;
  1410. X!         gc_fontsize[op] = size;
  1411. X          }
  1412. X      XDrawString(tool_d, w, gccache[op], x, y, string, strlen(string));
  1413. X      }
  1414. X***************
  1415. X*** 166,191 ****
  1416. X      XGCValues gcv;
  1417. X      int i;
  1418. X  
  1419. X!     gcv.fill_style = FillStippled;    /* Tiled */;
  1420. X      gcv.arc_mode = ArcPieSlice;    /* fill mode for arcs */
  1421. X      for (i=0; i<NUMFILLPATS; i++)
  1422. X          {
  1423. X-         /******************************************************
  1424. X-         fill_pm[i] = XCreatePixmapFromBitmapData(tool_d, XtWindow(canvas_sw),
  1425. X-                 fill_images[i],8,8,
  1426. X-                 x_fg_color.pixel,x_bg_color.pixel,
  1427. X-                 DefaultDepthOfScreen(tool_s));
  1428. X-         *******************************************************/
  1429. X          /* if we want the area fill to be "meshed" on top of existing
  1430. X             filled objects, then we must use stippling.  This means
  1431. X             creating a one-plane bitmap and setting the stipple part
  1432. X!            of the gc and selecting stipple fill mode.  This created
  1433. X!            a problem on the color machines in that it picked random
  1434. X!            colors to paint the stipple.  It should have used the 
  1435. X!            foreground color in the given gc with the FillPolygon call,
  1436. X!            but it didn't.
  1437. X          */
  1438. X-         /* use the following for stippling */
  1439. X          fill_pm[i] = XCreateBitmapFromData(tool_d, XtWindow(canvas_sw),
  1440. X                  fill_images[i],8,8);
  1441. X          /* create pixmaps of area-fill colors for indicator */
  1442. X--- 168,183 ----
  1443. X      XGCValues gcv;
  1444. X      int i;
  1445. X  
  1446. X!     gcv.fill_style = FillOpaqueStippled;
  1447. X      gcv.arc_mode = ArcPieSlice;    /* fill mode for arcs */
  1448. X+     gcv.fill_rule = EvenOddRule/*WindingRule*/;
  1449. X      for (i=0; i<NUMFILLPATS; i++)
  1450. X          {
  1451. X          /* if we want the area fill to be "meshed" on top of existing
  1452. X             filled objects, then we must use stippling.  This means
  1453. X             creating a one-plane bitmap and setting the stipple part
  1454. X!            of the gc and selecting stipple fill mode.
  1455. X          */
  1456. X          fill_pm[i] = XCreateBitmapFromData(tool_d, XtWindow(canvas_sw),
  1457. X                  fill_images[i],8,8);
  1458. X          /* create pixmaps of area-fill colors for indicator */
  1459. X***************
  1460. X*** 196,203 ****
  1461. X          fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
  1462. X          un_fill_gc[i] = makegc(ERASE, x_fg_color.pixel, x_bg_color.pixel);
  1463. X          gcv.stipple = fill_pm[i];
  1464. X!         XChangeGC(tool_d, fill_gc[i], GCStipple|GCFillStyle|GCArcMode, &gcv);
  1465. X!         XChangeGC(tool_d, un_fill_gc[i], GCStipple|GCFillStyle|GCArcMode, &gcv);
  1466. X          }
  1467. X      }
  1468. X  
  1469. X--- 188,197 ----
  1470. X          fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
  1471. X          un_fill_gc[i] = makegc(ERASE, x_fg_color.pixel, x_bg_color.pixel);
  1472. X          gcv.stipple = fill_pm[i];
  1473. X!         XChangeGC(tool_d, fill_gc[i], 
  1474. X!             GCStipple|GCFillStyle|GCFillRule|GCArcMode, &gcv);
  1475. X!         XChangeGC(tool_d, un_fill_gc[i], 
  1476. X!             GCStipple|GCFillStyle|GCArcMode, &gcv);
  1477. X          }
  1478. X      }
  1479. X  
  1480. X***************
  1481. X*** 369,401 ****
  1482. X      XtAddConverter("Int", "Float", CvtIntToFloat, NULL, 0);
  1483. X  }
  1484. X  
  1485. X! pw_vector(w, x1, y1, x2, y2, op, line_width)
  1486. X  Window w;
  1487. X! int x1, y1, x2, y2, op, line_width;
  1488. X      {
  1489. X!     set_line_width(line_width,op);
  1490. X      XDrawLine(tool_d, w, gccache[op], x1, y1, x2, y2);
  1491. X      }
  1492. X  
  1493. X! 
  1494. X! pw_put(w, x, y, op, line_width)
  1495. X! Window w;
  1496. X! int x,y,op,line_width;
  1497. X      {
  1498. X-     op = op? PAINT : ERASE;
  1499. X-     set_line_width(line_width,op);
  1500. X-     XDrawPoint(tool_d, w, gccache[op], x, y);
  1501. X-     }
  1502. X- 
  1503. X- pw_lines(w, points, npoints, op, line_width, area_fill)
  1504. X- Window w;
  1505. X- int npoints;
  1506. X- XPoint *points;
  1507. X- int op,line_width,area_fill;
  1508. X-     {
  1509. X      GC gc;
  1510. X  
  1511. X-     set_line_width(line_width,op);
  1512. X      if (area_fill)
  1513. X          {
  1514. X          if (op == PAINT)
  1515. X--- 363,388 ----
  1516. X      XtAddConverter("Int", "Float", CvtIntToFloat, NULL, 0);
  1517. X  }
  1518. X  
  1519. X! pw_vector(w, x1, y1, x2, y2, op, line_width, line_style, style_val)
  1520. X  Window w;
  1521. X! int x1, y1, x2, y2, op, line_width, line_style;
  1522. X! float style_val;
  1523. X      {
  1524. X!     if (line_width == 0)
  1525. X!         return;
  1526. X!     set_line_stuff(line_width,line_style,style_val,op);
  1527. X      XDrawLine(tool_d, w, gccache[op], x1, y1, x2, y2);
  1528. X      }
  1529. X  
  1530. X! pw_lines(w, points, npoints, op, line_width, line_style, style_val, area_fill)
  1531. X! Window    w;
  1532. X! int    npoints;
  1533. X! XPoint    *points;
  1534. X! int    op,line_width,line_style,area_fill;
  1535. X! float    style_val;
  1536. X      {
  1537. X      GC gc;
  1538. X  
  1539. X      if (area_fill)
  1540. X          {
  1541. X          if (op == PAINT)
  1542. X***************
  1543. X*** 405,432 ****
  1544. X          XFillPolygon(tool_d, w, gc, points, npoints,
  1545. X              Complex, CoordModeOrigin);
  1546. X          }
  1547. X      XDrawLines(tool_d, w, gccache[op], points, npoints, CoordModeOrigin);
  1548. X      }
  1549. X  
  1550. X! pw_rectangle(w, x, y, width, height, op, line_width)
  1551. X! Window w;
  1552. X! int x,y,width,height;
  1553. X! int op,line_width;
  1554. X      {
  1555. X-     set_line_width(width,op);
  1556. X-     XDrawRectangle(tool_d, w, gccache[op], x, y, width, height);
  1557. X-     }
  1558. X- 
  1559. X- set_line_width(width,op)
  1560. X- int width,op;
  1561. X-     {
  1562. X      XGCValues gcv;
  1563. X  
  1564. X!     if (width != cur_thickness[op])
  1565. X          {
  1566. X!         gcv.line_width = width == 1? 0: width;    /* use 0 width for 1 (much faster) */
  1567. X!         XChangeGC(tool_d, gccache[op], GCLineWidth, &gcv);
  1568. X!         cur_thickness[op] = width;
  1569. X          }
  1570. X      }
  1571. X- 
  1572. X--- 392,432 ----
  1573. X          XFillPolygon(tool_d, w, gc, points, npoints,
  1574. X              Complex, CoordModeOrigin);
  1575. X          }
  1576. X+     if (line_width == 0)
  1577. X+         return;
  1578. X+     set_line_stuff(line_width, line_style, style_val, op);
  1579. X      XDrawLines(tool_d, w, gccache[op], points, npoints, CoordModeOrigin);
  1580. X      }
  1581. X  
  1582. X! set_line_stuff(width,style,style_val,op)
  1583. X! int    width,style,op;
  1584. X! float    style_val;
  1585. X      {
  1586. X      XGCValues gcv;
  1587. X+     unsigned long mask;
  1588. X+     char dash_list[2];
  1589. X  
  1590. X!     if (width == gc_thickness[op] && style == gc_line_style[op])
  1591. X!         return;
  1592. X!     gcv.line_width = (width == 1? 0: width); /* use 0 width for 1 (much faster) */
  1593. X!     mask = GCLineWidth|GCLineStyle;
  1594. X!     gcv.line_style = (style==SOLID_LINE)? LineSolid: LineOnOffDash;
  1595. X!     if (style==SOLID_LINE)
  1596. X!         XChangeGC(tool_d, gccache[op], mask, &gcv);
  1597. X!     else
  1598. X!         {
  1599. X!         mask |= GCDashList;
  1600. X!         if (style_val > 0.0)    /* style_val of 0.0 causes problems */
  1601. X          {
  1602. X!         gcv.dashes = (char) style_val;
  1603. X!         XChangeGC(tool_d, gccache[op], mask, &gcv);
  1604. X!         /* length of ON/OFF pixels */
  1605. X!         dash_list[0]=dash_list[1] = (char) style_val;
  1606. X!         if (style == DOTTED_LINE)
  1607. X!             dash_list[0] = 1;    /* length of ON pixels for dotted */
  1608. X!         XSetDashes(tool_d, gccache[op], 0, dash_list, 2);
  1609. X          }
  1610. X+            }
  1611. X+     gc_thickness[op] = width;
  1612. X+     gc_line_style[op] = style;
  1613. X      }
  1614. END_OF_FILE
  1615. if test 7317 -ne `wc -c <'xtra.c.diff'`; then
  1616.     echo shar: \"'xtra.c.diff'\" unpacked with wrong size!
  1617. fi
  1618. # end of 'xtra.c.diff'
  1619. fi
  1620. echo shar: End of archive 3 \(of 7\).
  1621. cp /dev/null ark3isdone
  1622. MISSING=""
  1623. for I in 1 2 3 4 5 6 7 ; do
  1624.     if test ! -f ark${I}isdone ; then
  1625.     MISSING="${MISSING} ${I}"
  1626.     fi
  1627. done
  1628. if test "${MISSING}" = "" ; then
  1629.     echo You have unpacked all 7 archives.
  1630.     rm -f ark[1-9]isdone
  1631. else
  1632.     echo You still need to unpack the following archives:
  1633.     echo "        " ${MISSING}
  1634. fi
  1635. ##  End of shell archive.
  1636. exit 0
  1637.  
  1638. dan
  1639. -----------------------------------------------------------
  1640.             O'Reilly && Associates
  1641.         argv@sun.com / argv@ora.com
  1642.        632 Petaluma Ave, Sebastopol, CA 95472 
  1643.      800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
  1644.     Opinions expressed reflect those of the author only.
  1645.